package base.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TestShuidi {
    public static void main(String[] args) {
        //要求输出其中的shuidi
        String s = "welcome to shui&di";
        String str = null;
        Pattern p = Pattern.compile("([a-z]{2,})(&)([a-z]{2})");
        Matcher m = p.matcher(s);
        while (m.find()){
            str = m.group(1);
            System.out.println(str);
        }

    }
}
